package ro.dta.idbi.interfaces.ui;

import java.awt.Image;

import javax.swing.Icon;
import javax.swing.JTabbedPane;

import ro.dta.idbi.interfaces.ApplicationSections;

/**
 * Main frame interface Contains the main operations for the main interface
 * 
 * @author Tudor Dobrila
 * 
 */
public interface IMainFrame {

	/**
	 * Set the text in the status bar of the frame
	 * 
	 * @param newText
	 *            New text to display in the frame
	 */
	void setStatusBarText(String newText);

	/**
	 * Get the repository browser panel
	 * 
	 * @return Repository browser panel
	 */
	IRepositoryBrowser getRepositoryBrowser();

	/**
	 * Get the command history panel associated with the project
	 * 
	 * @return Command history panel associated with the project
	 */
	IHistoryPanel getHistoryPanel();

	/**
	 * Get the right panel
	 * 
	 * @return The right panel on this form
	 */
	JTabbedPane getRightPane();

	/**
	 * Change to another section in the right panel
	 * 
	 * @param name
	 *            Name of the section
	 * @param params
	 *            Extra parameters used to initialise the new section
	 * @param tabTitle
	 *            Title of the tab containing the section
	 * @param tabIcon
	 *            Icon displayed in the tab containing the section
	 * @param title
	 *            Title of the section
	 * @param successMessage
	 *            Success message to display in the status bar after loading
	 */
	void open(ApplicationSections name, Object[] params, String tabTitle, Icon tabIcon,
			String title, String successMessage);

	/**
	 * Get the icon image of the frame
	 * 
	 * @return Icon of the frame
	 */
	Image getIconImage();

	/**
	 * Get the GUI factory associated with the frame
	 * 
	 * @return GUI factory associated with the frame
	 */
	IGuiFactory getGuiFactory();

	/**
	 * Set the new title of the application
	 * 
	 * @param title
	 *            New title of the application
	 */
	void setTitle(String title);

	/**
	 * Show or hide the repository browser
	 * 
	 * @param selected
	 *            True to show repository browser, false to hide it
	 */
	void showRepBrowser(boolean selected);

	/**
	 * Save a screenshot of the main frame to disk
	 * 
	 * @param path
	 *            Path where to save the screenshot
	 * @return True if the save was performed successfully, false otherwise
	 */
	boolean saveScreenshot(String path);
}
